﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="quan_tri_doi_tac.ascx.cs" Inherits="quan_tri_doi_tac" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<telerik:RadAjaxManager OnAjaxRequest="Ajax_Request" ID="RadAjaxManager1" runat="server" 
    DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    <AjaxSettings>
       <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grdContact" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="grdContact">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                <telerik:AjaxUpdatedControl ControlID="grdContact" />
                <telerik:AjaxUpdatedControl ControlID="lblMessage" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>

<telerik:RadScriptBlock runat="server" ID="script1">
    <script type="text/javascript" language="javascript">
        function Window_Close() {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
        }
    </script>
</telerik:RadScriptBlock>

<telerik:RadWindowManager  ID="RadWindowManager1" runat="server" >
    <Windows>
        <telerik:RadWindow OnClientClose="Window_Close" VisibleStatusbar="false" Width="100%" Height="100%" runat="server" ID="windows1"></telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

<asp:Label runat="server" ID="lblMessage"></asp:Label>
<fieldset>
<legend><span style="color:Blue">QUẢN TRỊ ĐỐI TÁC</span></legend>
    <table width="100%">
        <tr>
            <td style="width:85%"> </td>
            <td><a href="/Admin/Form/Contact_Add.aspx" ><img src="/Image/add2.png" alt="Thêm mới đối tác" title="Thêm mới đối tác" />Thêm Mới</a></td>
            </tr>
      </table>
     

<telerik:RadGrid runat="server" AllowFilteringByColumn="True" Skin="WebBlue" GridLines="Horizontal" AllowSorting="true" ID="grdContact" AutoGenerateColumns="false"  >
    <MasterTableView NoDetailRecordsText="Không có dữ liệu">
        <Columns>
           <telerik:GridTemplateColumn AutoPostBackOnFilter="true" AllowFiltering="true" HeaderText="Tên Đối Tác" DataField="ContactName">                
                <ItemTemplate>
                    <a href="/Admin/Form/Contact_Add.aspx?id=<%#DataBinder.Eval(Container.DataItem,"ContactID")%>">
                    <%# Eval("ContactName")%></a>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
           
           <telerik:GridImageColumn ImageHeight="100px" ImageWidth="130px" DataImageUrlFields="ContactImage" HeaderText="Ảnh đại diện"></telerik:GridImageColumn>
           <telerik:GridBoundColumn DataField="CompanyName" HeaderText="Công ty" AllowFiltering="true"></telerik:GridBoundColumn>
           <telerik:GridBoundColumn Visible="false" DataField="ContactEmail" HeaderText="Email" AllowFiltering="true"></telerik:GridBoundColumn>
           <telerik:GridBoundColumn Visible="false" DataField="ContactTelephone" HeaderText="Điện Thoại" AllowFiltering="true"></telerik:GridBoundColumn>
           <telerik:GridBoundColumn Visible="false" DataField="ContactMobilePhone" HeaderText="Di Động" AllowFiltering="true"></telerik:GridBoundColumn>
           <telerik:GridBoundColumn Visible="false" DataField="ContactFax" HeaderText="Fax" AllowFiltering="true"></telerik:GridBoundColumn>
           <telerik:GridBoundColumn Visible="false" DataField="ContactAbstract" HeaderText="Tóm tắt" AllowFiltering="true"></telerik:GridBoundColumn>
           <telerik:GridBoundColumn Visible="false" DataField="ContactContent" HeaderText="Nội Dung" AllowFiltering="true"></telerik:GridBoundColumn>
           <telerik:GridBoundColumn DataField="ViewOrder" HeaderText="Thứ tự" AllowFiltering="true"></telerik:GridBoundColumn>
           <telerik:GridCheckBoxColumn DataField="IsTypical" HeaderText="Nổi bật" AllowFiltering="true"></telerik:GridCheckBoxColumn>
           <telerik:GridCheckBoxColumn DataField="IsApproved" HeaderText="Duyệt" AllowFiltering="true"></telerik:GridCheckBoxColumn>
            <telerik:GridTemplateColumn AllowFiltering="false" HeaderText="Xóa" >
                <ItemStyle Width="20px" />
                <ItemTemplate>
                    <asp:LinkButton OnClientClick="return ConfirmDelete()" runat="server" ID="btnDelete" CausesValidation="false" CommandArgument='<%# Eval("ContactID") %>' OnClick="Contact_Delete" >Delete</asp:LinkButton>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
